#
#	This file is part of Flight_Chess_Portable
#	Copyright (C) 2008  Poison
#
#	This program is free software: you can redistribute it and/or modify
#	it under the terms of the GNU General Public License as published by
#	the Free Software Foundation, either version 3 of the License, or
#	(at your option) any later version.
#
#	This program is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#	GNU General Public License for more details.
#
#	You should have received a copy of the GNU General Public License
#	along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

#	File:		Makefile
#	Author:		Poison <hbpoison@gmail.com>
#	Date Created:	2008-02-20

TARGET			= Flight_Chess_Portable
SRCS			= MemMgr.cpp FileMgr.cpp Thread.cpp App.cpp main.cpp
OBJS			= $(SRCS:.cpp=.o)

BUILD_PRX		= 1
PSP_FW_VERSION	= 390

INCDIR			=
LIBDIR			=
LDFLAGS			=
LIBS			= -lstdc++
CFLAGS			= -O2 -G0 -g -Wall -D_PRX_MODE=$(BUILD_PRX)
CXXFLAGS		= $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS			= $(CFLAGS)

ifeq ($(BUILD_PRX),1)
PRX_EXPORTS		= exports.exp
LDFLAGS			+= -mno-crt0 -nostartfiles
endif

EXTRA_TARGETS	= EBOOT.PBP
PSP_EBOOT_TITLE	= Flight Chess Portable
PSP_EBOOT_ICON 	=

PSPSDK			= $(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak

install:
	rm -rf $(TARGET)
	mkdir $(TARGET)
	cp $(EXTRA_TARGETS) $(TARGET)/
	cp -R $(TARGET) /Volumes/NO\ NAME/PSP/GAME/
	diskutil eject /Volumes/NO\ NAME/
